]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Multiply blur sigma value with the scale factor
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 11 Feb 2020 19:19:50 +0000 (20:19 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 12 Feb 2020 14:11:03 +0000 (11:11 -0300)
Since the blur sigma decides how many pixels get factored in when
blurring and setting a scale factor increases the background texture by
that factor, the sigma value should also be multiplied by the scale
factor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/991

js/ui/unlockDialog.js

index 9dc809b4d40811eb02e4f04846ba389b2c6e4b99..0e01e9aacca63a3b96d676f58e204bdaa6f7207e 100644 (file)
@@ -514,10 +514,18 @@ var UnlockDialog = GObject.registerClass({
 
         this._backgroundGroup.add_child(widget);
 
-        widget.add_effect(new Shell.BlurEffect({
+        const themeContext = St.ThemeContext.get_for_stage(global.stage);
+
+        let effect = new Shell.BlurEffect({
             brightness: BLUR_BRIGHTNESS,
-            sigma: BLUR_SIGMA,
-        }));
+            sigma: BLUR_SIGMA * themeContext.scale_factor,
+        });
+
+        this._scaleChangedId = themeContext.connect('notify::scale-factor', () => {
+            effect.sigma = BLUR_SIGMA * themeContext.scale_factor;
+        });
+
+        widget.add_effect(effect);
     }
 
     _updateBackgrounds() {
@@ -679,6 +687,12 @@ var UnlockDialog = GObject.registerClass({
             Main.layoutManager.disconnect(this._monitorsChangedId);
             delete this._monitorsChangedId;
         }
+
+        let themeContext = St.ThemeContext.get_for_stage(global.stage);
+        if (this._scaleChangedId) {
+            themeContext.disconnect(this._scaleChangedId);
+            delete this._scaleChangedId;
+        }
     }
 
     cancel() {